#ifndef KMYSCRIPT_H
#define KMYSCRIPT_H

#include <string>
#include <map>
#include <vector>
using namespace std;

#include "../KmyStream.h"
#include "../KmyStructDef.h"
#include "KmyVar.h"

class KmyScript
{
public:
    KmyScript();
    KmyScript(string &name, KmyStream *head_s, KmyStream *body_s, KmyStream *text_s);
    ~KmyScript();
    void finalize();

    string name;
//    int head_size;
//    string* head;
//    int body_size;
//    string* body;
    vector<string> body;
//    int text_size;
//    string* text;
    vector<St_Buff*> text;

//    bool gotoaddr(string &label);
    int getAnchorAddr(const string &Anchor);

    string getInstruction(int ip);
private:
//    int IP;
//    int RP;
//    int DP;
//    int RStack[64];
//    void* DStack[64];
    map<string, int> anchor;
    map<string, KmyVar*> port_var;
};

#endif // KMYSCRIPT_H
